//
//  HEHealthDetailItemCell.m
//  HealthFamily
//
//  Created by 吴欧 on 2020/12/8.
//  Copyright © 2020 honglutec. All rights reserved.
//

#import "HEHealthDetailItemCell.h"

@interface HEHealthDetailItemCell ()

@property (nonatomic, strong) UILabel *nameLb;
@property (nonatomic, strong) UILabel *valeLb;

@end

@implementation HEHealthDetailItemCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
    if (self=[super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        
        self.selectionStyle = UITableViewCellSelectionStyleNone;
        
        self.qmui_borderPosition = QMUIViewBorderPositionTop;
        self.qmui_borderWidth = 0.5;
        self.qmui_borderColor = CSplitLineColor;
     
        [self initUI];
    }
    return self;
}

- (void)initUI {
    // 排名
    UILabel *nameLb = [UILabel new];
    nameLb.font = DYFont(16);
    nameLb.textColor = CNavDargGrayColor;
    [self.contentView addSubview:nameLb];
    _nameLb = nameLb;
    
    // 排名
    UILabel *valeLb = [UILabel new];
    valeLb.font = DYFont(16);
    valeLb.textColor = CNavDargGrayColor;
    [self.contentView addSubview:valeLb];
    _valeLb = valeLb;
    
    [nameLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.equalTo(self.contentView).mas_offset(15);
        make.left.equalTo(self.contentView).mas_offset(15);
        make.right.equalTo(valeLb.mas_left).mas_offset(-10);
        make.bottom.equalTo(self.contentView).mas_offset(-15);
    }];
    
    [valeLb mas_makeConstraints:^(MASConstraintMaker *make) {
        make.centerY.equalTo(nameLb);
        make.right.equalTo(self.contentView).mas_offset(-15);
    }];
    [valeLb setContentHuggingPriority:UILayoutPriorityRequired forAxis:UILayoutConstraintAxisHorizontal];
}

- (void)setModel:(HEHealthNodeModel *)model {
    _nameLb.text = model.health_name;
    _valeLb.text = [NSString stringWithFormat:@"+%@分", model.health_value];
    
    _valeLb.textColor = model.socerColor;

}

@end
